home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 008 / src / hack.h < prev    next >
C/C++ Source or Header  |  1995-03-17  |  5KB  |  147 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2. /* hack.h version 1.0.1 - added some flags for HACKOPTIONS */
  3.  
  4. #include "mklev.h"
  5. #include "hack.onames.h"
  6.  
  7. #define MUP    1
  8. #define MDOWN  2
  9.  
  10. #define ON 1
  11. #define OFF 0
  12.  
  13. extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg, 
  14.    *uleft, *uright, *fcobj;
  15. extern struct obj *uchain;   /* defined iff PUNISHED */
  16. extern struct obj *uball;   /* defined if PUNISHED */
  17. struct obj *o_at(), *getobj(), *sobj_at();
  18.  
  19. struct flag {
  20.     unsigned ident;        /* social security number for each monster */
  21.     Bitfield(topl,2);    /* a top line (message) has been printed */
  22.                 /* 0: top line empty; 2: no --More-- reqd. */
  23.     Bitfield(cbreak,1);    /* in cbreak mode, rogue format */
  24.     Bitfield(oneline,1);    /* give inventories 1 line at a time */
  25.     Bitfield(time,1);    /* display elapsed 'time' */
  26.     Bitfield(nonews,1);    /* suppress news printing */
  27.     Bitfield(notombstone,1);
  28.      unsigned end_top, end_around;    /* describe desired score list */
  29.     Bitfield(end_own,1);        /* idem (list all own scores) */
  30.     Bitfield(no_rest_on_space,1);    /* spaces are ignored */
  31.     Bitfield(move,1);
  32.     Bitfield(mv,1);
  33.     Bitfield(run,3);    /* 0: h (etc), 1: H (etc), 2: fh (etc) */
  34.                 /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
  35.     Bitfield(nopick,1);    /* do not pickup objects */
  36.     Bitfield(echo,1);    /* 1 to echo characters */
  37.     Bitfield(botl,1);    /* partially redo status line */
  38.     Bitfield(botlx,1);    /* print an entirely new bottom line */
  39.     Bitfield(nscrinh,1);    /* inhibit nscr() in pline(); */
  40. };
  41. extern struct flag flags;
  42.  
  43. struct prop {
  44. #define   TIMEOUT      007777   /* mask */
  45. #define   LEFT_RING   W_RINGL   /* 010000L */
  46. #define   RIGHT_RING   W_RINGR   /* 020000L */
  47. #define   INTRINSIC   040000L
  48. #define   LEFT_SIDE   LEFT_RING
  49. #define   RIGHT_SIDE   RIGHT_RING
  50. #define   BOTH_SIDES   (LEFT_SIDE | RIGHT_SIDE)
  51.    long p_flgs;
  52.    int (*p_tofn)();   /* called after timeout */
  53. };
  54.  
  55. struct you {
  56.    xchar ux, uy;
  57.    schar dx, dy;      /* direction of fast move */
  58. #ifdef QUEST
  59.    schar di;      /* direction of FF */
  60.    xchar ux0, uy0;      /* initial position FF */
  61. #endif QUEST
  62.    xchar udisx, udisy;   /* last display pos */
  63.    char usym;      /* usually '@' */
  64.    schar uluck;
  65.    int last_str_turn:3;   /* 0: none, 1: half turn, 2: full turn */
  66.             /* +: turn right, -: turn left */
  67.    Bitfield(udispl,1);   /* @ on display */
  68.    Bitfield(ulevel,5);
  69. #ifdef QUEST
  70.    Bitfield(uhorizon,7);
  71. #endif QUEST
  72.    Bitfield(utrap,3);   /* trap timeout */
  73.    Bitfield(utraptype,1);   /* defined if utrap nonzero */
  74. #define   TT_BEARTRAP   0
  75. #define   TT_PIT      1
  76.    Bitfield(uinshop,1);
  77.  
  78.  
  79. /* perhaps these #define's should also be generated by makedefs */
  80. #define   TELEPAT      LAST_RING      /* not a ring */
  81. #define   Telepat      u.uprops[TELEPAT].p_flgs
  82. #define   FAST      (LAST_RING+1)      /* not a ring */
  83. #define   Fast      u.uprops[FAST].p_flgs
  84. #define   CONFUSION   (LAST_RING+2)      /* not a ring */
  85. #define   Confusion   u.uprops[CONFUSION].p_flgs
  86. #define   INVIS      (LAST_RING+3)      /* not a ring */
  87. #define   Invis      u.uprops[INVIS].p_flgs
  88. #define   GLIB      (LAST_RING+4)      /* not a ring */
  89. #define   Glib      u.uprops[GLIB].p_flgs
  90. #define   PUNISHED   (LAST_RING+5)      /* not a ring */
  91. #define   Punished   u.uprops[PUNISHED].p_flgs
  92. #define   SICK      (LAST_RING+6)      /* not a ring */
  93. #define   Sick      u.uprops[SICK].p_flgs
  94. #define   BLIND      (LAST_RING+7)      /* not a ring */
  95. #define   Blind      u.uprops[BLIND].p_flgs
  96. #define   WOUNDED_LEGS   (LAST_RING+8)      /* not a ring */
  97. #define Wounded_legs   u.uprops[WOUNDED_LEGS].p_flgs
  98. #define PROP(x) (x-RIN_ADORNMENT)       /* convert ring to index in uprops */
  99.    Bitfield(umconf,1);
  100.    char *usick_cause;
  101.    struct prop uprops[LAST_RING+9];
  102.  
  103.    Bitfield(uswallow,1);      /* set if swallowed by a monster */
  104.    Bitfield(uswldtim,4);      /* time you have been swallowed */
  105.    Bitfield(uhs,3);         /* hunger state - see hack.eat.c */
  106.    schar ustr,ustrmax;
  107.    schar udaminc;
  108.    schar uac;
  109.    int uhp,uhpmax;
  110.    long int ugold,ugold0,uexp,urexp;
  111.    int uhunger;         /* refd only in eat.c and shk.c */
  112.    int uinvault;
  113.    struct monst *ustuck;
  114.    int nr_killed[CMNUM+2];      /* used for experience bookkeeping */
  115. };
  116.  
  117. extern struct you u;
  118.  
  119. extern char *traps[];
  120. extern char *plur(), *monnam(), *Monnam(), *amonnam(), *Amonnam(),
  121.    *doname(), *aobjnam();
  122. extern char readchar();
  123. extern char vowels[];
  124.  
  125. extern xchar curx,cury;   /* cursor location on screen */
  126.  
  127. extern coord bhitpos;   /* place where thrown weapon falls to the ground */
  128.  
  129. extern xchar seehx,seelx,seehy,seely; /* where to see*/
  130. extern char *save_cm,*killer;
  131.  
  132. extern xchar dlevel, maxdlevel; /* dungeon level */
  133.  
  134. extern long moves;
  135.  
  136. extern int multi;
  137.  
  138.  
  139. extern char lock[];
  140.  
  141.  
  142. #define DIST(x1,y1,x2,y2)       (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2)))
  143.  
  144. #define   PL_CSIZ      20   /* sizeof pl_character */
  145. #define   MAX_CARR_CAP   120   /* so that boulders can be heavier */
  146. #define   FAR   (COLNO+2)   /* position outside screen */
  147.